<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>05_腾讯2</title>
</head>
<body>
<!--
1. 难度系数: ★★★
2. 技术点:
  1). 变量提升
  2). IIFE
  3). 作用域与作用域链
  4). 变量查找
-->
<script type="text/javascript">
  /*var name = 'World!'
  ;(function () {
    if (typeof name === 'undefined') {
      var name = 'Jack'
      console.log(name)
    } else {
      console.log(name)
    }
  })()*/


  var name;
  name = 'World!'
  ;(function () {
      var name;
      if (typeof name === 'undefined') {
          name = 'Jack'
          console.log(name)
      } else {
          console.log(name)
      }
  })()

</script>
</body>
</html>
